package com.sztest.jayjun.utils;

import java.text.DecimalFormat;

/*
 *  @项目名：  jayjun
 *  @包名：    com.sztest.jayjun.utils
 *  @文件名:   NumUtils
 *  @创建者:   okmin
 *  @创建时间:  2022/7/5 14:29
 *  @描述：    TODO
 */
public class NumUtils {

    public static double getOneDecimal4(double num) {
        DecimalFormat dFormat = new DecimalFormat("#.0000");

        String yearString = dFormat.format(num);

        Double temp = Double.valueOf(yearString);

        return temp;

    }

    public static double getOneDecimal1(double num) {
        DecimalFormat dFormat = new DecimalFormat("#.0");

        String yearString = dFormat.format(num);

        Double temp = Double.valueOf(yearString);

        return temp;
    }
}
